#!/bin/sh
# A simple bash script to build the zip file for grading purposes
# To execute this file you may need to first execute the following:
# chmod +x submit.sh       (this makes this script executable by the owner )

#usage: ./submit.sh netid1 [netid2]

files="mymem.c RESPONSES"
suffix="lmp2.zip"

if [ $# -eq 0 ]; then
	echo -e "Please include your netid(s) as arguments to this script:\n $0 netid1 [netid2]" ; exit 1
else if [ $# -gt 2 ]; then 
	echo -e "A maximum of two netids can be included per zip file"; exit 1
     fi
fi
netids="${1}-${2}"

archive="${netids}-${suffix}"
oldArchive="${archive}.old"

if [ -f "$archive" ]; then mv "${archive}" "${oldArchive}" ; fi 
echo -e "Building $archive \n which you can upload to Compass."
echo -e "The archive should contain $files"
zip  $archive $files



